package com.keepsport.keepsportapi.service.impl;
import com.keepsport.keepsportapi.dao.PalnDao;
import com.keepsport.keepsportapi.entity.Palntable;
import com.keepsport.keepsportapi.service.intf.PalnService;
import com.keepsport.keepsportapi.vo.R;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class PalnServiceImpl implements PalnService {
    @Resource
    private PalnDao dao;

    @Override
    public R selectByType(int type) {
        //校验参数
        if (type > 0) {
            List<Palntable> list = dao.selectByType(type);
            if (list != null) {
                return R.ok(list);
            }
        }
        return R.fail();
    }

    @Override
    public R selectById(Integer id) {
        if (id >0) {
            List<Palntable> select = dao.selectById1(id);
            if (select != null) {
                return R.ok(select);
            }
        }
        return R.fail();


    }
}